#ifndef SCREEN_H
#define SCREEN_H
#include <cstdint>
#define ENERGY_POINT_COUNT 256
struct NPC {
    int x;
    int y;
    int type;
};
void init_energy_points();
void init_npcs_randomly();
void screen_show();
void play_screen();
void role_display();
int get_direction(int angle, int mag);
void background_display(void);
void draw_EP_value(void);
void check_energy_point_collision(void);
void update_role_position_and_direction(void);
void check_level_up(void); 
void reference_background(void);
void move_npc_randomly(NPC &npc, int min_x, int max_x, int min_y, int max_y);
void setting_screen(void);
void draw_border(void);
void npc_display(NPC npcs[], int num_npcs, int screen_width, int screen_height);
void weapon_act(void);
void instruction_screen(void);
void check_npc_attack_range(void);
void achievement_screen(void);
void check_role_state(void);
void game_init(void);
void victory_screen(void);
void init_heart_points(void);
void check_heart_collision(void); 
extern uint8_t level_up_flag;
extern uint8_t weapon_state;
extern char facing_direction;
extern uint8_t role_heat_flag;
extern uint8_t role_health;
extern int screen_offset_x,screen_offset_y;
void death_screen(void);
//Map element coordinates, later to be replaced by random generation
const uint16_t barrel_pos[][2] = {
    {120, 150}, {180, 180}, {230, 220}, {300, 180}, {350, 250},
    {400, 120}, {450, 200}, {500, 300}, {550, 350}, {600, 280}
};
extern uint16_t energy_point_pos[ENERGY_POINT_COUNT][2];


extern uint8_t kill_count;
extern uint8_t current_level,current_experience,level_up_threshold;
extern NPC npcs[25];
//extern NPC npcs_init[25];
extern uint8_t screen_state, menu_index,setting_index,instruction_index,achievement_index;
extern int volume_level,brightness_level,difficulty_level;
#endif